function data = cornerPlot(MonteCarlosResult,TrueResult,axisLabels)

NumberOfElements = size(MonteCarlosResult,1);
dataNumb = size(MonteCarlosResult,2);
figure;

variable_row = 1;
ii_hist = [];
ind_temp = 1;
MeanSave = [];
STDsave = [];
for ii = 1:NumberOfElements+1:NumberOfElements^2;
    subplot(NumberOfElements,NumberOfElements,ii);
    h = histogram(MonteCarlosResult(variable_row,:)); hold on;
    MEAN = mean(MonteCarlosResult(variable_row,:));
    STD = std(MonteCarlosResult(variable_row,:));
    MeanSave = [MeanSave,MEAN-TrueResult(variable_row)];
    STDsave = [STDsave,STD];
    xline(TrueResult(variable_row),'LineWidth',2,'Color','r');
%     title(sprintf('%s\n',axisLabels{ind_temp}))
    title({sprintf('%s',axisLabels{ind_temp});['\mu_{error} = ',num2str(MEAN-TrueResult(variable_row))]; ['\sigma = ', num2str(STD)]});

%     text = sprintf('\mu : %f, \sigma : %f:',MEAN,STD)
%     text(MEAN,max(h.Values),text)
    ind_temp = ind_temp+1;
    variable_row = variable_row+1;
    ii_hist = [ii_hist,ii];
    set(gca,'FontSize',12)

end
ind_all = 1:NumberOfElements^2;
ind_need = [];
for ii = 1:length(ind_all);
    temp = ind_all(ii)-ii_hist;
    if sum(temp==0)>=1
        continue
    else
        ind_need = [ind_need,ii];
    end
end
temp_nxn = zeros(NumberOfElements,NumberOfElements);
count = 1;
for i = 1:NumberOfElements
    for j = 1:NumberOfElements

        temp(i,j) = count;
        count = count + 1;

    end
end

for ii = ind_need
    [data1,data2] = find(temp==ii);
    if data1 < data2
        continue
    end
    subplot(NumberOfElements,NumberOfElements,ii)
    hold on
    plot(MonteCarlosResult(data2,:),MonteCarlosResult(data1,:),'k.');
    %     error_ellipse(cov(MonteCarlosResult(data1,:),MonteCarlosResult(data2,:)),...
    %         [TrueResult(data1),TrueResult(data2)],'conf',0.99)
    error_ellipse(cov(MonteCarlosResult(data2,:),MonteCarlosResult(data1,:)),...
        [mean(MonteCarlosResult(data2,:)),mean(MonteCarlosResult(data1,:))],'conf',0.95)
    %     error_ellipse(cov(MonteCarlosResult(data1,:),MonteCarlosResult(data2,:)),...
    %         [TrueResult(data1),TrueResult(data2)],'conf',0.67)
    xline(TrueResult(data2),'LineWidth',1,'Color','r','LineStyle','--');
    yline(TrueResult(data1),'LineWidth',1,'Color','r','LineStyle','--');

    % xlabel(sprintf('%s',axisLabels{data2}))
    %     ylabel(sprintf('%s',axisLabels{data1}))

    if data2==1;   
        ylabel(sprintf('%s',axisLabels{data1}))
    end

    if data1==NumberOfElements;
        xlabel(sprintf('%s',axisLabels{data2}))
    end
    set(gca,'FontSize',12)
end

data = abs([MeanSave',STDsave']);

end
